package com.yangjun.controller.businessAnalysis.categoryCenter;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.yangjun.service.bussiness.TaskTraceService;

import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@RestController
@RequestMapping(value="/api/business/taskTrace/",method=RequestMethod.GET)
public class TaskTraceController {
	@Autowired
	public TaskTraceService taskTraceService;
	
	@ApiOperation(value="获取实际综合完成率的柱状图",notes="根据月份筛选")
	@ResponseBody
	@RequestMapping(value="queryGeneraleDoneRateRank")
	public Map<String,Object> queryGeneraleDoneRateRank(
			@ApiParam(required = true, name ="month", value ="月份") @RequestParam(value = "month",required = false)String month){
//		month="201703";
		return taskTraceService.queryGeneraleDoneRateRank(month);
	}
	@ApiOperation(value="获取任务完成详情表格",notes="根据月份筛选")
	@ResponseBody
	@RequestMapping(value="queryTaskDoneTable")
	public List<Object[]> queryTaskDoneTable(
			@ApiParam(required = true, name ="month", value ="月份") @RequestParam(value = "month",required = false)String month){
//		month="201703";
		return taskTraceService.queryTaskDoneTable(month);
	}
	@ApiOperation(value="获取科室销售详情",notes="根据月份筛选")
	@ResponseBody
	@RequestMapping(value="queryDeparmentSalesTable")
	public List<Object[]> queryDeparmentSalesTable(
			@ApiParam(required = true, name ="month", value ="月份") @RequestParam(value = "month",required = false)String month){
//		month="201703";
		return taskTraceService.queryDeparmentSalesTable(month);
	}
	
	@ApiOperation(value="获取上月本月月对比折线图",notes="根据员工名，科室名，月份来筛选")
	@ResponseBody
	@RequestMapping(value="queryDepartmentSalesLineChartByDay")
	public Map<String,Object> queryPharmacistComparisonLineChartByDay(
			@ApiParam(required = true, name ="staffName", value ="员工名") @RequestParam(value = "staffName",required = false)String staffName,
			@ApiParam(required = true, name ="department", value ="科室名") @RequestParam(value = "department",required = false)String department,
			@ApiParam(required = true, name ="month", value ="月份") @RequestParam(value = "month",required = false)String month){
//		staffName = "陈宇鹏";
//		department = "男科";
//		month = "201703";
		return taskTraceService.queryDepartmentSalesLineChartByDay(staffName, department, month);
	}
}
